package com.pcrc.app;

import java.util.HashMap;
import java.util.Map;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import android.webkit.WebView;
import android.widget.Button;

public class test extends Activity {
	public String sid;
	public String url;
	public CookieManager cookieManager;
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.wv);
        sid=getIntent().getStringExtra("sid");
        url=getIntent().getStringExtra("url");
        

        System.out.print("aa");
        CookieManager cookie=CookieManager.getInstance();
        cookie.setCookie("http://pcrc.co.kr","PHPSESSID="+sid);
        CookieSyncManager.getInstance().sync();
        WebView wv=(WebView)findViewById(R.id.wv);
       
        wv.loadUrl("http://pcrc.co.kr/board/"+url);
        
	}
	 @Override
	    public void onResume() 
	    {
	        super.onResume();
	        CookieSyncManager.getInstance().startSync();
	    }
	@Override
	public void onPause() {
	        super.onPause();
	        
	        if (CookieSyncManager.getInstance() != null) {
	        CookieSyncManager.getInstance().stopSync();
	        }
	}
	@Override
	protected void onDestroy() {
	        super.onDestroy();
	        
	        if (cookieManager != null) {
	        cookieManager.removeAllCookie();
	        }
	}
	
}
